<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSearchKeywordRecordTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //搜索历史
        Schema::create('user_search_record',function(Blueprint $table)
        {
            $table->increments('id');
            $table->integer('user_id')->nullable()->comment('用户id');
            $table->string('keyword')->nullable()->comment('关键词');
            $table->string('ip')->nullable()->comment('ip地址');
            $table->softDeletes();
            $table->timestamps();
        });
        //关键词统计
        Schema::create('search_keyword_record',function(Blueprint $table)
        {
            $table->increments('id');
            $table->string('keyword')->nullable()->comment('关键词');
            $table->integer('number')->default(1)->comment('搜索次数');
            $table->softDeletes();
            $table->timestamps();
        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
